gnttab: limit mapkind()'s iteration count
authorJan Beulich <jbeulich@suse.com>
Thu, 22 Jun 2017 07:55:08 +0000 (09:55 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 22 Jun 2017 07:55:08 +0000 (09:55 +0200)
commit31777889db4a379da66c35a68d60ccbcf290971c
tree33aae0e1757f7d48b2c04f1a03bb77206885f48d
parent95906bf0f0b03a30a5f104b8ca89fa1ac0286f32
gnttab: limit mapkind()'s iteration count

There's no need for the function to observe increases of the maptrack
table (which can occur as the maptrack lock isn't being held) - actual
population of maptrack entries is excluded while we're here (by way of
holding the respective grant table lock for writing, while code
populating entries acquires it for reading). Latch the limit ahead of
the loop, allowing for the barrier to move out, too.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/common/grant_table.c